import { Get, Post } from "./axios.js";
// import store from '@/vuex/store';

/**
 * {Content-Type": "application/json; charset=UTF-8} 刷新token
 * @param {username, password}
 */
// 获取官网新闻
export const selectNewsList = (param) => {
  return Post("/newsManage/public/selectNewsList", param);
};

// 获取官网新闻详情
export const selectNewsById = (param) => {
  return Get("/newsManage/public/selectNewsById", param);
};

// 获取职位
export const getRecruitmentList = (param) => {
  return Post("recruitment/getRecruitmentList/1", param);
};

// 获取时政新闻、行业新闻列表
export const selectXinHuaNewsList = (param) => {
  return Post("/newsManage/public/selectXinHuaNewsList", param);
};

// 获取时政新闻、行业新闻详情
export const selectXinHuaNewsById = (param) => {
  return Get("/newsManage/public/selectXinHuaNewsById", param);
};

// 获取产品分类树形结构
export const selectProductCategoryTree = () => {
  return Get("/bounty/bountyProductCategory/tree");
};

export const selectProductCategoryDetail = (id) => {
  return Get(`/bounty/bountyProductCategory/${id}`);
};

// 获取慈善组织分类列表
export const selectCharityCategoryTree = () => {
  return Get("/bounty/bountyCharityCategory/list");
};

export const selectCharityList = () => {
  return Get(`/bounty/bountyCharityContent/list`);
};

export const selectBlogCategoryList = () => {
  return Get("/bounty/bountyBlogCategory/list");
};

export const selectProductList = () => {
  return Get("/bounty/bountyProduct/list");
};

export const pageSelectProductList = (param) => {
  return Get("/bounty/bountyProduct/page", param);
};

export const selectProductDetail = (id) => {
  return Get(`/bounty/bountyProduct/${id}`);
};

export const selectProductCategoryList = () => {
  return Get("/bounty/bountyProductCategory/list");
};

export const selectCharityCategoryDetail = (id) => {
  return Get(`/bounty/bountyCharityCategory/${id}`);
};

export const selectCharityContentInfo = (id) => {
  return Get(`/bounty/bountyCharityContent/${id}`);
};

export const pageSelectBlogList = (param) => {
  return Get("/bounty/bountyBlog/page", param);
};

export const selectBlogDetail = (id) => {
  return Get(`/bounty/bountyBlog/${id}`);
};

export const listSelectBlogCategory = () => {
  return Get("/bounty/bountyBlogCategory/list");
};

export const selectProductCategoryWithProducts = () => {
  return Get("/bounty/bountyProduct/categoryProduct");
};

export const bountySubscribe = (data) => {
  return Post("/bounty/bountySubscribe", data);
};
